<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
<style> 
div
{
    position: absolute;
    left: 200px;
    width:100px;
    height:100px;
    background:red;
    opacity: 0.3;
    animation:myfirst 2s;
    -webkit-animation:myfirst 2s; /* Safari and Chrome */
}

@keyframes myfirst
{
    from {background:white;width:0px;height: 0px;opacity: 1}
    to {background:red;width:100px;height: 100px;opacity: 0.3}
}

@-webkit-keyframes myfirst /* Safari and Chrome */
{
    from {background:white;width:0px;height: 0px;opacity: 1}
    to {background:red;width:100px;height: 100px;opacity: 0.3}
}
</style>
</head>
<body>

<p><b>注意:</b> 该实例在 Internet Explorer 9 及更早 IE 版本是无效的。</p>

<div>123</div>

</body>
</html>